package at.fhhagenberg.hydrac.java.sample.ast.codegen.sample;
public class SumCalculator {

	private final int[] argc;

	private int min = Integer.MAX_VALUE;
	private int max = Integer.MIN_VALUE;

	public SumCalculator() {
		argc = new int[] { 1, 2, 7, 1, 9, 4, 7 };
	}

	private void calc(){
		for (int i = 1; i < argc.length; i++) {
			int val = argc[i];
			if (val > max) {
				max = val;
			}
			if (val < min) {
				min = val;
			}
		}
	}

	private void printResult(){
		System.out.println("minimum = " + min + " maximum = " + max + "\n");
	}


	public static void main(String[] args) {
		SumCalculator cal = new SumCalculator();
		cal.calc();
		cal.printResult();
	}

}
